<template>
  <section class="container">
    <div>
      <h1 class="red">Hello {{ name }}!</h1>
      <app-logo/>
      <h1 class="title">
        nuxt-demo
      </h1>
      <h2 class="subtitle">
        Nuxt.js project
      </h2>
      <div class="links">
        <a
          href="hello/hello"
          class="button--green">Hello</a>
        <a
          href="https://github.com/nuxt/nuxt.js"
          target="_blank"
          class="button--grey">GitHub</a>
      </div>
    </div>
  </section>
</template>

<script>
import AppLogo from '~/components/AppLogo.vue'

export default {
  data(){
    return {
      name: 'world'
    }
  },
  components: {
    AppLogo
  },
  head(){
    return {
      title: '更改标题',
      meta: [
        { hid: 'description', name: 'description', content: 'My custom description' }
      ]
    }
  },
  mounted(){
    let a = 3
    let obj = {
     a: 10,
     toa: function(){
      console.log(this.a)
     },
     tob:{
      a: 20,
      toa: function(){
        console.log(this.a)
      }
     },
     toc:function(){
      // console.log(this.a)
      function aa(){
        console.log(this.a)
      }
      aa.call({a:44})
     }
    }
    obj.toa.call({a:50})
    obj.toa()
    obj.tob.toa()
    obj.toc()
  },
}
</script>

<style>
.container {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.title {
  font-family: "Quicksand", "Source Sans Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; /* 1 */
  display: block;
  font-weight: 300;
  font-size: 100px;
  color: #35495e;
  letter-spacing: 1px;
}

.subtitle {
  font-weight: 300;
  font-size: 42px;
  color: #526488;
  word-spacing: 5px;
  padding-bottom: 15px;
}

.links {
  padding-top: 15px;
}

.red{
  color: red;
}
</style>
